<template>
  <div>
    <el-card>
      <div class="topInquire">
      <!-- 服务器 -->
      <Server @server-event="handleSelectServer"></Server>

      <!-- 渠道 -->
      <Channel @channel-event="handleSelectChannel"></Channel>


      </div>
      <div>
        <el-button
          icon="el-icon-circle-plus-outline"
          type="primary"
          size="small"
          @click="handleCleanCache"
        >管理员清理缓存</el-button>
      </div>
    </el-card>

    

  </div>
</template>

<script>
import Server from '@/components/selectServer/index.vue'
import Channel from '@/components/selectChannel/index.vue'
import { cleanCache } from '@/api/serverManage'

export default {
  components: {
    Server,Channel
    },
    data(){
      return{
        selectChannel:[],
        selectServer:[]
      }
    },
    methods:{
      // 操作选中的渠道
      handleSelectChannel(value){
        this.selectChannel = value
        console.log('组件操作选中的渠道',this.selectChannel);
      },

      // 操作选中的服务器
      handleSelectServer(value){
        this.selectServer = value
        console.log('组件操作选中的服务器',this.selectServer);
      },

      //清理缓存
      handleCleanCache() {
        cleanCache();
      }
    }
}
</script>

<style lang="scss" scoped>
  .topInquire{
    font-weight: bold;
    font-size: 14px;
    color: #6a7488;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
  }
</style>